package com.easyfile.easyfilemaster.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * 用户简略信息类
 * @author chenpeman
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserInfo {
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    private String mobile;
    private String username;
    private String sex;
    private String portrait;
    private Double maxCapacity;
    private Double usedCapacity;

    public UserInfo(UserDetail userDetail){
        this.id=userDetail.getId();
        this.mobile=userDetail.getMobile();
        this.username=userDetail.getUsername();
        this.sex=userDetail.getSex();
        this.portrait=userDetail.getPortrait();
        this.maxCapacity=userDetail.getMaxCapacity();
        this.usedCapacity=userDetail.getUsedCapacity();
    }
}
